//
//  MeController.m
//  ox
//
//  Created by 喻杰 on 2016/10/28.
//  Copyright © 2016年 fengge. All rights reserved.
//

#import "MeController.h"
#import "ViewController.h"
#import "PhotoWallController.h"



@interface MeController()

@end

@implementation MeController

@synthesize table;


- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"牛牛";

    table.frame =[UIScreen mainScreen].bounds;
    table.dataSource = self;
    table.delegate = self;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    if(section ==0)
        return 2;
    return 3;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 3;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell* cell =[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil];
    if(indexPath.section ==0 && indexPath.row == 0){
        cell.textLabel.text= @"照片墙";
       // cell.detailTextLabel.text = @"喻唅翀";
        cell.imageView.image = [UIImage imageNamed:@"photoWall"];
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
       
    }else if(indexPath.section ==0 && indexPath.row == 1){
        cell.textLabel.text= @"足迹";
        // cell.detailTextLabel.text = @"喻唅翀";
        cell.imageView.image = [UIImage imageNamed:@"foot"];
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }
    
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{

    if(indexPath.section == 0 && indexPath.row == 0){
//        CATransition *action  =[CATransition animation];
//        action.duration = 1;
//        action.type = @"pageCurl" ;
//        action.subtype = kCATransitionFromLeft;
//        action.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
//        [self.navigationController.view.layer addAnimation:action forKey:nil];
//        HMGLTransitionManager * manager = [HMGLTransitionManager sharedTransitionManager];
       // ClothTransition * act  =[[ClothTransition alloc] init];
//        DoorsTransition * doors = [[DoorsTransition alloc] init ];
//        [doors setTransitionType:DoorsTransitionTypeOpen];
//        FlipTransition * filp  = [[FlipTransition alloc]init ];
//        [filp setTransitionType:FlipTransitionLeft ];
     //   RotateTransition * rotate = [[RotateTransition alloc] init];
       // Switch3DTransition * sw  =[[Switch3DTransition alloc] init];
       // [sw setTransitionType:Switch3DTransitionLeft];
       // [manager setTransition:sw];
        
        
        PhotoWallController * view  = [[PhotoWallController alloc]init];
        
        //[manager beginTransition:self.navigationController.view];
        CATransition * trans = [CATransition animation];
        trans.type = @"suckEffect";
        trans.subtype = kCATransitionFromRight;
        trans.duration = 1;
        trans.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
        [self.navigationController.view.layer addAnimation:trans forKey:nil];
        [self.navigationController pushViewController:view animated:YES];
        //[manager  commitTransition];
    }
    else if(indexPath.section == 0 && indexPath.row == 1){
        CATransition * trans = [CATransition animation];
        trans.type = @"pageCurl";
        trans.subtype = kCATransitionFromLeft;
        trans.duration = 1;
        trans.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
        [self.navigationController.view.layer addAnimation:trans forKey:nil];
        ViewController * view = [[ViewController alloc]init];
        [self.navigationController pushViewController:view animated:YES];
    }
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    if(section == 0)
        return 0;
    return 5;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return 5;
}

@end
